package sonia.examples.rlm;

import javax.swing.JButton;
import javax.swing.JFrame;

import rlm.RuleLayoutManager;
import alm.ALMException;

public class Flow extends JFrame{
	
	public static void main(String[] args) throws ALMException{
		Flow flow = new Flow();
		flow.setVisible(true);
		
	}
	
	public Flow() throws ALMException{
		super("Flow example");
		this.setDefaultCloseOperation(EXIT_ON_CLOSE);
		setLayout(new RuleLayoutManager("src/sonia/examples/rlm/layouts/Dock2.drl"));
		setSize(500,300);
		
		for(int i = 0; i < 4; i++){
			JButton button = new JButton("button"+(i+1));
			this.add(button);
		}
	}
	
public void showBorderLayoutDemo() throws ALMException{
	JFrame frame = new JFrame("Demo");
	frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
	
	frame.setLayout(new RuleLayoutManager("src/examples/rlm/layouts/Flow2.drl"));
	frame.setSize(500,300);
	
	for(int i = 0; i < 4; i++){
		JButton button = new JButton("button"+(i+1));
			frame.add(button);
		}
		
	frame.setVisible(true);
}
}
